package com.detection.common.perimeter.hikvision;

/**
 * @author LH
 * @date 2022/11/9 9:58
 */
public enum SectorsStatusType {

    ANOMALY(0,"异常"),

    NORMAL(1,"布防"),

    DISARMING(2,"撤防"),

    ALARM(3,"报警");

    public Integer type;

    private String name;

    SectorsStatusType(Integer type, String name) {
        this.type = type;
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static SectorsStatusType get(Integer type){
        for (SectorsStatusType value : SectorsStatusType.values()) {
            if(value.getType().intValue() == type.intValue()){
                return value;
            }
        }
        return null;
    }

    public static String  getName(Integer type){
        SectorsStatusType statusType = get(type);
        return statusType != null ? statusType.getName() : "";
    }
}
